﻿using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Animation;

namespace 前端系统
{
    /// <summary>
    /// MessageWindow.xaml 的交互逻辑
    /// </summary>
    
    public partial class MessageWindow : Window
    {
        int Mode;

        public MessageWindow(string text, int Modes)
        {
            InitializeComponent();
            Message_Text.Text = text;
            Mode = Modes;
            Top = (SystemParameters.PrimaryScreenHeight - Height) / 2;
            Left = (SystemParameters.PrimaryScreenWidth - Width) / 2;
            (First_Border.FindResource("Start") as Storyboard).Begin(this);
        }

        private void Button_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
        {
            Button.Background = new SolidColorBrush(Color.FromRgb(83, 145, 255));
        }

        private void Button_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
        {
            Button.Background = new SolidColorBrush(Color.FromRgb(30, 111, 255));
        }

        private void Button_MouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            if (Mode == 1)
            {
                (First_Border.FindResource("Exit") as Storyboard).Begin(this);
                AKui.Delay(500);
                this.Close();
            }
            else if (Mode == 2)
            {
                (First_Border.FindResource("Exit") as Storyboard).Begin(this);
                AKui.Delay(500);
                Application.Current.Shutdown();
            }
        }

    }
}
